home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1997-10-16 | 14.1 KB | 533 lines | [ TEXT/KAHL]
/* Balloony.r - the definitions of resources that are easily describable textually. November 11, 1996: I, David Phillip Oster, place this source code in the public domain. This means you can do anyhing you want with it. It would be considerate if you kept me posted on any bugs, bug fixes, or improvements. oster@netcom.com */ #include "Types.r" #include "SysTypes.r" #include "BalloonTypes.r" #include "BalloonyRes.h" #define hMenuBase 2000 #define hDlogBase 3000 include "Balloony.RESOURCES"; resource 'DLOG' (rAbout, purgeable) { {80, 66, 215, 383}, dBoxProc, invisible, noGoAway, 0x0, rAbout, "About" }; resource 'DITL' (rAbout, purgeable) {{ /* [1] */ {145, 240, 165, 298}, Button { enabled, "OK" }, /* [2] */ {145, 162, 165, 220}, Button { enabled, "Cancel" }, /* [3] */ {9, 12, 74, 303}, StaticText {enabled, "Balloony: Version 1.00. A program to create stub balloon help .r files from an application. Just drop your application onto it." }, /* [4] */ {74, 12, 130, 303}, StaticText {enabled, "Copyright © by David Phillip Oster, 1994, All Rights Reserved. Write to me at oster@netcom.com for more information." }, /* [5] */ {0, 0, 0, 0}, helpItem { disabled, HMScanhdlg {rAbout} } }}; #define AboutHdlg hDlogBase+rAbout resource 'STR#' (AboutHdlg, purgeable) {{ /* 1 */ "Click here to make this dialog box go away." }}; /* The 'dlg' resource connects ditl items to STR# items. */ resource 'hdlg' (rAbout, purgeable) { HelpMgrVersion, 0, /* start with first item */ hmDefaultOptions, 0, /* balloon def id */ 0, /* var code, hang right */ HMSkipItem {}, /* default item */ { HMSkipItem {}, HMSkipItem {}, HMStringResItem {{0,0}, {0,0,0,0}, AboutHdlg, 1, AboutHdlg, 1, AboutHdlg, 1, AboutHdlg, 1 }, HMStringResItem {{0,0}, {0,0,0,0}, AboutHdlg, 1, AboutHdlg, 1, AboutHdlg, 1, AboutHdlg, 1 } }}; resource 'dctb' (rAbout, purgeable) {{ wContentColor, 48059, 48059, 48059, wFrameColor, 0, 0, 0, wTextColor, 0, 0, 0, wHiliteColor, 0, 0, 0, wTitleBarColor, 65535, 65535, 65535 }}; resource 'DLOG' (rProgress, purgeable) { {80, 66, 183, 343}, dBoxProc, invisible, noGoAway, 0x0, rProgress, "Progress" }; #define kBoxL 7 #define kBoxT 61 resource 'DITL' (rProgress, purgeable) {{ /* [1] */ {130, 740, 150, 798}, Button { enabled, "OK" }, /* [2] */ {62, 165, 82, 223}, Button { enabled, "Cancel" }, /* [3] */ {32, 12, 57, 241}, StaticText {disabled, "" }, /* [4] */ {9, 12, 26, 241}, StaticText {disabled, "Now adding stub Balloon Help to:" }, /* [5] */ {0, 0, 0, 0}, helpItem { disabled, HMScanhdlg { rProgress } } }}; #define ProgressHdlg hDlogBase+rProgress resource 'STR#' (ProgressHdlg, purgeable) {{ /* 1 */ "Balloony is building the stub help resources for this item." }}; /* The 'dlg' resource connects ditl items to STR# items. */ resource 'hdlg' (rProgress, purgeable) { HelpMgrVersion, 0, /* start with first item */ hmDefaultOptions, 0, /* balloon def id */ 0, /* var code, hang right */ HMSkipItem {}, /* default item */ { HMSkipItem {}, /* OK */ HMSkipItem {}, /* Cancel */ HMStringResItem {{0,0}, {0,0,0,0}, ProgressHdlg, 1, ProgressHdlg, 1, ProgressHdlg, 1, ProgressHdlg, 1 } }}; resource 'dctb' (rProgress, purgeable) {{ wContentColor, 48059, 48059, 48059, wFrameColor, 0, 0, 0, wTextColor, 0, 0, 0, wHiliteColor, 0, 0, 0, wTitleBarColor, 65535, 65535, 65535 }}; resource 'DLOG' (rOptions, purgeable) { {80, 66, 243, 383}, movableDBoxProc, invisible, noGoAway, 0x0, rOptions, "Balloony" }; #define kBoxL 7 #define kBoxT 61 resource 'DITL' (rOptions, purgeable) {{ /* [1] */ {130, 240, 150, 298}, Button { enabled, "OK" }, /* [2] */ {130, 162, 150, 220}, Button { enabled, "Cancel" }, /* [3] */ {73, 10, 91, 30}, RadioButton {enabled, "" }, /* [4] */ {95, 10, 112, 30}, RadioButton {enabled, "" }, /* [5] */ {65, 30, 97, 62}, Icon { disabled, 130 }, /* [6] */ {90, 30, 122, 62}, Icon { disabled, 129 }, }}; resource 'dctb' (rOptions, purgeable) {{ wContentColor, 48059, 48059, 48059, wFrameColor, 0, 0, 0, wTextColor, 0, 0, 0, wHiliteColor, 0, 0, 0, wTitleBarColor, 65535, 65535, 65535 }}; resource 'ALRT' (rError, "Error", purgeable) { {56, 64, 184, 438}, rError, { OK, visible, sound1, OK, visible, sound1, OK, visible, sound1, OK, visible, sound1 }}; resource 'DITL' (rError, "Error", purgeable) {{ {98, 300, 118, 360}, Button { enabled, "OK" }, {9, 55, 93, 360}, StaticText { disabled, "^0 (^1)" }, {9, 12, 41, 44}, Icon { disabled, 0 } }}; #define kAllItems 0x7FFFFFFF #define kItem1 (1 << (1 - 1)) #define kItem2 (1 << (2 - 1)) resource 'MENU' (kAppleMenu, "kAppleMenu") { kAppleMenu, textMenuProc, 0x7FFFFFFD, enabled, apple, { "About Balloony…", noIcon, noKey, noMark, plain, "-", noIcon, noKey, noMark, plain }}; #define kAppleHmnu hMenuBase+kAppleMenu resource 'STR#' (kAppleHmnu, purgeable) {{ /* 1 */ "The Apple menu contains commands for bringing up items in the Apple Menu Item folder in your System Folder.", /* 2 */ "This brings up a dialog box with information about this program." }}; /* The 'hmnu' resource connects menu items to STR# items. */ resource 'hmnu' (kAppleMenu, purgeable) { HelpMgrVersion, hmDefaultOptions, 0, /* balloon def id */ 0, /* var code, hang right */ HMSkipItem {}, /* default item */ { HMStringResItem {kAppleHmnu, 1, kAppleHmnu, 1, kAppleHmnu, 1, kAppleHmnu, 1 }, HMStringResItem {kAppleHmnu, 2, kAppleHmnu, 2, kAppleHmnu, 2, kAppleHmnu, 2 } }}; resource 'MENU' (kFileMenu, "kFileMenu") { kFileMenu, textMenuProc, allEnabled, enabled, "File", { "Open", noIcon, "O", noMark, plain, "-", noIcon, noKey, noMark, plain, "Quit", noIcon, "Q", noMark, plain }}; #define kFileHmnu hMenuBase+kFileMenu resource 'STR#' (kFileHmnu, purgeable) {{ /* 1 */ "The File menu contains commands for the general operation of this program.", /* 2 */ "Open\n\nOpens an application <App> and makes a file named “<App> Help.r” with template balloon help for the menus and dialogs.", /* 3 */ "Quit\n\nQuits this program." }}; /* The 'hmnu' resource connects menu items to STR# items. */ resource 'hmnu' (kFileMenu, purgeable) { HelpMgrVersion, hmDefaultOptions, 0, /* balloon def id */ 0, /* var code, hang right */ HMSkipItem {}, /* default item */ { HMStringResItem {kFileHmnu, 1, kFileHmnu, 1, kFileHmnu, 1, kFileHmnu, 1 }, HMStringResItem {kFileHmnu, 2, kFileHmnu, 2, kFileHmnu, 2, kFileHmnu, 2 }, HMSkipItem {}, HMStringResItem {kFileHmnu, 3, kFileHmnu, 3, kFileHmnu, 3, kFileHmnu, 3 } }}; resource 'MENU' (kEditMenu, "kEditMenu") { kEditMenu, textMenuProc, kAllItems - (kItem2), enabled, "Edit", { /* array: 6 elements */ "Undo", noIcon, "Z", noMark, plain, "-", noIcon, noKey, noMark, plain, "Cut", noIcon, "X", noMark, plain, "Copy", noIcon, "C", noMark, plain, "Paste", noIcon, "V", noMark, plain, "Clear", noIcon, noKey, noMark, plain } }; #define kEditHmnu hMenuBase+kEditMenu resource 'STR#' (kEditHmnu, purgeable) {{ /* 1 */ "The Edit menu has commands relating to editing text. It is here only for compatibility.", /* 2 */ "Undo\n\nlets you undo your changes. Not implemented in this program.", /* 3 */ "Cut\n\nlets you move your selection to the clipboard. Not implemented in this program.", /* 4 */ "Copy\n\nlets you duplicate your selection in the clipboard. Not implemented in this program.", /* 5 */ "Paste\n\nlets you replace your selection with the contents of the clipboard. Not implemented in this program.", /* 6 */ "Clear\n\nlets you delete your selection. Not implemented in this program." }}; /* The 'hmnu' resource connects menu items to STR# items. */ resource 'hmnu' (kEditMenu, purgeable) { HelpMgrVersion, hmDefaultOptions, 0, /* balloon def id */ 0, /* var code, hang right */ HMSkipItem {}, /* default item */ { HMStringResItem {kEditHmnu, 1, kEditHmnu, 1, kEditHmnu, 1, kEditHmnu, 1 }, HMStringResItem {kEditHmnu, 2, kEditHmnu, 2, kEditHmnu, 2, kEditHmnu, 2 }, HMSkipItem {}, HMStringResItem {kEditHmnu, 3, kEditHmnu, 3, kEditHmnu, 3, kEditHmnu, 3 }, HMStringResItem {kEditHmnu, 4, kEditHmnu, 4, kEditHmnu, 4, kEditHmnu, 4 }, HMStringResItem {kEditHmnu, 5, kEditHmnu, 5, kEditHmnu, 5, kEditHmnu, 5 }, HMStringResItem {kEditHmnu, 6, kEditHmnu, 6, kEditHmnu, 6, kEditHmnu, 6 } }}; resource 'MBAR' (kMBAR, purgeable) {{ kAppleMenu, kFileMenu, kEditMenu }}; resource 'STR#' (kMainStrs, purgeable) {{ "Help.r", "Balloony Prefs", "KAHL", "TEXT", "\n\tHMSkipItem {}" }}; resource 'STR#' (kSmallStrs) {{ "^1", /* the menu/ditl resource name (also the hmnu/hdlg one.) */ "^2", /* the STR# resource name */ "^3", /* the current STR# string number */ "-", /* a dividing line in a menu */ "1", ",\n", ",", "h", "Menu", "Hmnu", "cntl", "button", "checkBox", "radioButton", "text", "edit", "icon", "pict", "user", "Unknown", "Ditl", "Hdlg" }}; resource 'STR#' (kErrorStrs, purgeable) {{ "An error occurred.", "Directory full.", /* kDirFulErr */ "Disk full.", /* kDskFulErr */ "No such volume.", /* kNsvErr */ "I/O error.", /* kIOErr */ "Bad Name.", /* kBdNamErr */ "File not open.", /* kFnOpnErr */ "End of file.", /* kEofErr */ "Tried to position to before start of file (r/w).", /* kPosErr */ "Memory full (open) or file won't fit (load).", /* kMFulErr */ "Too many files open.", /* kTmfoErr */ "File not found.", /* kFnfErr */ "Diskette is write protected.", /* kWPrErr */ "File is locked.", /* kFLckdErr */ "Volume is locked.", /* kVLckdErr */ "File is busy (delete).", /* kFBsyErr */ "Duplicate filename. Probably can’t create “…Help.r” output file because it already exists.", /* kDupFNErr */ "File already open with write permission.", /* kOpWrErr */ "Refnum error.", /* kRfNumErr */ "Get file position error.", /* kGfpErr */ "Volume not on line error (was Ejected).", /* kVolOffLinErr */ "Permissions error (on file open).", /* kPermErr */ "Drive volume already on-line at MountVol.", /* kVolOnLinErr */ "No such drive (tried to mount a bad drive num).", /* kNsDrvErr */ "Not a mac diskette (sig bytes are wrong).", /* kNoMacDskErr */ "Nolume in question belongs to an external fs.", /* kExtFSErr */ "File system internal error:during rename the old entry was deleted but could not be restored.", /* kFsRnErr */ "Bad master directory block.", /* kBadMDBErr */ "Write permissions error.", /* kWrPermErr */ "Directory not found.", /* kDirNFErr */ "No free WDCB available.", /* kTmwdoErr */ "Move into offspring error.", /* kBadMovErr */ "Wrong volume type error [operation not supported for MFS].", /* kWrgVolTypErr */ "Server volume has been disconnected.", /* kVolGoneErr */ "Insufficient memory to complete operation." /* kMemFullError */ }}; resource 'STR#' (kHMNUStringResStrs, purgeable){{ "\n\tHMStringResItem {", "^2", ", ", "^3", ", ", "^2", ", ", "^3", ", ", "^2", ", ", "^3", ", ", "^2", ", ", "^3", " }" }}; /* kHMNUHeaderStrs - one time file header the ^1 matches the filename here. */ resource 'STR#' (kHeaderStrs, purgeable) {{ "/* ", "^1", " - automatically generated stub file for balloon help.\n", "\tfrom Balloony, by David Phillip Oster, oster@netcom.com\n", "Connect hdlg's to dialogs by adding a line like this at the end of your DITLs:\n", " {0, 0, 0, 0}, helpItem { disabled, HMScanhdlg { <hdlgID> } }\n", " */\n\n", "#include \"BalloonTypes.r\"\n", "#define hMenuBase 2000\n", "#define hDlogBase 3000\n" }}; /* kHMNUNormal1Strs - before each normal menu Note: in this string, ^3 is the resID. */ resource 'STR#' (kHMNUNormal1Strs, purgeable) {{ "\n#define ", "^1", "\t", "^3", "\n", "#define ", "^2", " hMenuBase+", "^1", "\n", "resource 'STR#' (", "^2", ", purgeable) {{\n" }}; resource 'STR#' (kRepeatStrs, purgeable){{ " /* ", "^3", " */ \"", }}; resource 'STR#' (kHMNUMedialStrs, purgeable) {{ "\n}};\n\n/* The 'hmnu' resource connects menu items to STR# items.\n */\n", "resource 'hmnu' (", "^1", ", purgeable) {\n", " HelpMgrVersion,\n", " hmDefaultOptions,\n", " 0, /* balloon def id */\n", " 0, /* var code, hang right */\n", " HMSkipItem {}, /* default item */\n", " {" }}; resource 'STR#' (kHMNUCloseStrs, purgeable) {{ "\n}};\n" }}; resource 'STR#' (kHDLGStringResStrs, purgeable){{ "\n\tHMStringResItem {{0,0}, {0,0,0,0}, ", "^2", ", ", "^3", ", ", "^2", ", ", "^3", ", ", "^2", ", ", "^3", ", ", "^2", ", ", "^3", " }" }}; /* kHDLGNormal1Strs - before each normal dialog */ resource 'STR#' (kHDLGNormal1Strs, purgeable) {{ "\n#define ", "^1", "\t", "^3", "\n", "#define ", "^2", " hDlogBase+", "^1", "\n", "resource 'STR#' (", "^2", ", purgeable) {{\n" }}; resource 'STR#' (kHDLGMedialStrs, purgeable) {{ "\n}};\n\n/* The 'dlg' resource connects ditl items to STR# items.\n */\n", "resource 'hdlg' (", "^1", ", purgeable) {\n", " HelpMgrVersion,\n", " 0, /* start with first item */\n" " hmDefaultOptions,\n", " 0, /* balloon def id */\n", " 0, /* var code, hang right */\n", " HMSkipItem {}, /* default item */\n", " {" }}; resource 'STR#' (kHDLGCloseStrs, purgeable) {{ "\n}};\n" }}; resource 'BNDL' (128, purgeable) { 'by®D', 0, { 'FREF', { 0, 128, 1, 129, 2, 130, 3, 131, 4, 132, 5, 133 }, 'ICN#', { 0, 128, 1, 129 2, 0, 3, 0, 4, 0, 5, 0 } } }; type 'by®D' as 'STR '; resource 'by®D' (0, purgeable) { "Copyright © 1994 David Phillip Oster" }; resource 'FREF' (128, purgeable) { 'APPL', 0, "" }; resource 'FREF' (129, purgeable) { 'by®D', 1, "" }; resource 'FREF' (130, purgeable) { '????', 2, "" }; /* open resEdit resource files. */ resource 'FREF' (131, purgeable) { 'rsrc', 3, "" }; /* open Resorcerer resource files. */ resource 'FREF' (132, purgeable) { 'RSRC', 4, "" }; /* open desk accessory suitcase files. */ resource 'FREF' (133, purgeable) { 'dfil', 5, "" }; type 'TEXT' { string; }; resource 'TEXT' (128) { "Balloony: Version 1.00. A program to create stub balloon help .r files from an application. Just drop your application onto it. " "Copyright © by David Phillip Oster, 1994, All Rights Reserved. Write to me at oster@netcom.com for more information." }; resource 'hfdr' (-5696) { HelpMgrVersion, hmDefaultOptions, 0, 0, { HMTEResItem{ 128 } }}; resource 'vers' (1, purgeable) { 0x1, 0x0, final, 0x0, verUS, "Copyright © 1994 David Phillip Oster", "Copyright © 1994 David Phillip Oster, oster@netcom.com" };